﻿using System;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Automation.Text;

namespace QuickUIT.Controls
{
    /// <summary>
    /// Represents a generic control to be automated.  
    /// </summary>
    public class UIControl : UIBaseControl
    {
        /// <summary>
        /// Gets the dock position for the control. 
        /// If the control does not support the <see cref="DockPattern"/>, returns a null reference.  
        /// </summary>
        public new DockPosition? DockPosition
        {
            get { return base.DockPosition; }
        }

        /// <summary>
        /// Gets the current expand collapse state of the control.
        /// If the control does not support the <see cref="ExpandCollapsePattern"/> , returns a null reference.
        /// </summary>
        public new ExpandCollapseState? ExpandCollapseState
        {
            get { return base.ExpandCollapseState; }
        }

        /// <summary>
        /// Gets the current toggle state of the control.
        /// If the control does not support the <see cref="ToggleState"/> , returns a null reference.
        /// </summary>
        public new ToggleState? ToggleState
        {
            get
            {
                return base.ToggleState;
            }
        }

        /// <summary>
        /// Gets a value which indicates the primary direction of traversal for a table type control.
        /// If the control does not support the <see cref="TablePattern"/> , returns a null reference.
        /// </summary>
        public new RowOrColumnMajor? RowOrColumnMajor
        {
            get { return base.RowOrColumnMajor; }
        }

        /// <summary>
        /// Gets a the current state of a window control for the purposes of user interaction.
        /// If the control does not support the <see cref="WindowPattern"/>, returns a null reference. 
        /// </summary>
        public new WindowInteractionState? WindowInteractionState
        {
            get { return base.WindowInteractionState;  }
        }

        /// <summary>
        /// Gets the visual state of a window control (i.e. restored, minimized, maximized). 
        /// If the control does not support the <see cref="WindowPattern"/>, returns a null reference.
        /// </summary>
        public new WindowVisualState? WindowVisualState
        {
            get { return base.WindowVisualState; }
        }

        /// <summary>
        /// Specifies the total number of columns in the grid.  
        /// If the control does not support the <see cref="GridPattern"/>, returns -1. 
        /// </summary>
        public new int ColumnCount
        {
            get { return base.ColumnCount; }
        }

        /// <summary>
        /// Specifies the total number of rows in the grid.  
        /// If the control does not support the <see cref="GridPattern"/>, returns -1. 
        /// </summary>
        public new int RowCount
        {
            get { return base.RowCount; }
        }

        /// <summary>
        /// Specifies the ordinal number of the column that contains this cell or item. 
        /// If the control does not support the <see cref="GridItemPattern"/>, returns -1. 
        /// </summary>
        public new int Column
        {
            get { return base.Column; }
        }

        /// <summary>
        /// Specifies the number of columns spanned by this cell or item. 
        /// If the control does not support the <see cref="GridItemPattern"/>, returns -1. 
        /// </summary>
        public new int ColumnSpan
        {
            get { return base.ColumnSpan; }
        }

        /// <summary>
        /// Specifies the ordinal number of the row that contains this cell or item. 
        /// If the control does not support the <see cref="GridItemPattern"/>, returns -1. 
        /// </summary>
        public new int Row
        {
            get { return base.Row; }
        }

        /// <summary>
        /// Specifies the number of row spanned by this cell or item. 
        /// If the control does not support the <see cref="GridItemPattern"/>, returns -1. 
        /// </summary>
        public new int RowSpan
        {
            get { return base.RowSpan; }
        }

        /// <summary>
        /// Gets the value that is added to or subtracted from the range control value when a large change is made. 
        /// If the control does not support the <see cref="RangeValuePattern"/>, returns NaN.
        /// </summary>
        public new double LargeChange
        {
            get { return base.LargeChange; }
        }

        /// <summary>
        /// Gets the value that is added to or subtracted from the range control value when a large change is made. 
        /// If the control does not support the <see cref="RangeValuePattern"/>, returns NaN.
        /// </summary>
        public new double SmallChange
        {
            get { return base.SmallChange; }
        }

        /// <summary>
        /// Specifies the maximum range value supported by the control.
        /// If the control does not support the <see cref="RangeValuePattern"/>, returns NaN.
        /// </summary>
        public new double Maximum
        {
            get { return base.Maximum; }
        }

        /// <summary>
        /// Specifies the minimum range value supported by the control.
        /// If the control does not support the <see cref="RangeValuePattern"/>, returns NaN.
        /// </summary>
        public new double Minimum
        {
            get { return base.Minimum; }
        }

        /// <summary>
        /// Specifies the value of the control.
        /// If the control does not support the <see cref="RangeValuePattern"/>, returns NaN. 
        /// </summary>
        public new double RangeValue
        {
            get { return base.RangeValue; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can scroll horizontally. 
        /// </summary>
        public new bool HorizontallyScrollable
        {
            get { return base.HorizontallyScrollable; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can scroll horizontally. 
        /// </summary>
        public new bool VerticallyScrollable
        {
            get { return base.VerticallyScrollable; }
        }

        /// <summary>
        /// Gets the value of the horizontal scroll position.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN. 
        /// </summary>
        public new double HorizontalScrollPercent
        {
            get { return base.HorizontalScrollPercent; }
        }

        /// <summary>
        /// Gets the value of the vertical scroll position 
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double VerticalScrollPercent
        {
            get { return base.VerticalScrollPercent; }
        }

        /// <summary>
        /// Gets the value of the horizontal size of the viewable region.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double HorizontalViewSize
        {
            get { return base.HorizontalViewSize; }
        }

        /// <summary>
        /// Gets the value of the vertical size of the viewable region.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double VerticalViewSize
        {
            get { return base.VerticalViewSize; }
        }

        /// <summary>
        /// Gets a value that indicates whether an item is selected. 
        /// </summary>
        public new bool IsSelected
        {
            get { return base.IsSelected; }
        }

        /// <summary>
        /// Gets a value which indicates if the control allows more than one child element to be selected concurrently. 
        /// </summary>
        public new bool CanSelectMultiple
        {
            get { return base.CanSelectMultiple; }
        }

        /// <summary>
        /// Gets a value which indicates if the control requires at least one child element to be selected. 
        /// </summary>
        public new bool IsSelectionRequired
        {
            get { return base.IsSelectionRequired; }
        }

        /// <summary>
        /// Gets the text range that encloses the main text of a document. 
        /// </summary>
        public new TextPatternRange DocumentRange
        {
            get { return base.DocumentRange; }
        }

        /// <summary>
        /// Gets a value that indicates the type of text selection that is supported by the control. 
        /// </summary>
        public new SupportedTextSelection SupportedTextSelection
        {
            get { return base.SupportedTextSelection; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be moved. 
        /// </summary>
        public new bool CanMove
        {
            get { return base.CanMove; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be resized. 
        /// </summary>
        public new bool CanResize
        {
            get { return base.CanResize; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be rotated. 
        /// </summary>
        public new bool CanRotate
        {
            get { return base.CanRotate; }
        }

        /// <summary>
        /// Gets a value which indicates whether the value of a control is read-only. 
        /// </summary>
        public new bool IsReadOnly
        {
            get { return base.IsReadOnly; }
        }

        /// <summary>
        /// Gets a value which indicates whether the value is a range control is read-only
        /// </summary>
        public new bool IsRangeReadOnly
        {
            get { return base.IsRangeReadOnly; }
        }

        /// <summary>
        /// Gets the value of a control. 
        /// </summary>
        public new string Value
        {
            get { return base.Value; }
        }

        /// <summary>
        /// Gets a value which indicates whether a window control can be maximized. 
        /// </summary>
        public new bool CanMaximize
        {
            get { return base.CanMaximize; }
        }

        /// <summary>
        /// Gets a value which indicates whether a window control can be minimized. 
        /// </summary>
        public new bool CanMinimize
        {
            get { return base.CanMinimize; }
        }

        /// <summary>
        /// Gets a value which indicates whether a window control is modal. 
        /// </summary>
        public new bool IsModal
        {
            get { return base.IsModal; }
        }

        /// <summary>
        /// Gets a value which indicates whether a window control is the topmost element in z-order. 
        /// </summary>
        public new bool IsTopmost
        {
            get { return base.IsTopmost; }
        }

        /// <summary>
        /// Gets the current control specific view. 
        /// </summary>
        public new int CurrentView
        {
            get { return base.CurrentView; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIControl"/> class.
        /// </summary>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIControl(string locator) : base(locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIControl"/> class.
        /// </summary>
        /// <param name="parent">The parent of the control.</param>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIControl(UIBaseControl parent, string locator) : base(parent, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIControl"/> class.
        /// </summary>
        /// <param name="control">The automation element of the control.</param>
        public UIControl(AutomationElement control) : base(control)
        {
        }

        /// <summary>
        /// Sets the current dock position of the control.
        /// </summary>
        /// <param name="dockPosition">The new dock position.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Dock(DockPosition dockPosition)
        {
            base.Dock(dockPosition);
        }

        /// <summary>
        /// Expands the current element, displaying all its child nodes, controls or content. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Expand()
        {
            base.Expand();
        }

        /// <summary>
        /// Collapses the current element, hiding all its child nodes, controls or content. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Collapse()
        {
            base.Collapse();
        }

        /// <summary>
        /// Calls invoke a control to initiate or perform a single, unambiguous action that does not maintain state when activated.
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Invoke()
        {
            base.Invoke();
        }

        /// <summary>
        /// Retrieves an AutomationElement that represents the specified cell in a table or grid control. 
        /// </summary>
        /// <param name="row">The ordinal number of the row of interest.</param>
        /// <param name="col">The ordinal number of the column of interest.</param>
        /// <returns>The <see cref="AutomationElement"/> that represents the retrieved cell.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        /// <remarks>Grid coordinates are zero-based with the upper left (or upper right cell depending on locale) having coordinates (0,0).</remarks>
        public new AutomationElement GetItem(int row, int col)
        {
            return base.GetItem(row, col);
        }

        /// <summary>
        /// Retrieves a collection of integer values that identify the views available for a control.
        /// </summary>
        /// <returns>A collection of view identifiers. An empty collection is returned if there are no found view identifiers.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new int[] GetSupportedViews()
        {
            return base.GetSupportedViews();
        }

        /// <summary>
        /// Gets the name of a control specific view. 
        /// </summary>
        /// <param name="viewId">A view identifier.</param>
        /// <returns>The localized name of the view.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new string GetViewName(int viewId)
        {
            return base.GetViewName(viewId);
        }

        /// <summary>
        /// Sets the current control specific view. 
        /// </summary>
        /// <param name="viewId">The view identifier to set.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void SetCurrentView(int viewId)
        {
            base.SetCurrentView(viewId);
        }

        /// <summary>
        /// Scrolls the visible region of the content area horizontally and vertically. 
        /// </summary>
        /// <param name="horizontalAmount">The horizontal scrolling increment that is specific to the control.</param>
        /// <param name="verticalAmount">The vertical scrolling increment that is specific to the control.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        /// <remarks>No scroll should be passed if if the control cannot be scrolled in a given direction.</remarks>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount)
        {
            base.Scroll(horizontalAmount, verticalAmount);
        }

        /// <summary>
        /// Scrolls the visble region of the content area vertically by the <see cref="ScrollAmount"/>.
        /// </summary>
        /// <param name="amount">The vertical scrolling increment.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void ScrollVertically(ScrollAmount amount)
        {
            base.ScrollVertically(amount);
        }

        /// <summary>
        /// Scrolls the visble region of the content area horizontally by the <see cref="ScrollAmount"/>.
        /// </summary>
        /// <param name="amount">The horizontal scrolling increment.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void ScrollHorizontally(ScrollAmount amount)
        {
            base.ScrollHorizontally(amount);
        }

        /// <summary>
        /// Sets the horizontal and vertical scroll position as a percentage of the total content area within the control. 
        /// </summary>
        /// <param name="horizontalPercent">
        /// The percentage of the total horizontal content area. 
        /// <see cref="ScrollPattern.NoScroll"/> should be passed in if the control cannot be scrolled in this direction.
        /// </param>
        /// <param name="verticalPercent">
        /// The percentage of the total vertical content area. 
        /// <see cref="ScrollPattern.NoScroll"/> should be passed in if the control cannot be scrolled in this direction.
        /// </param>
        public new void SetScrollPercent(double horizontalPercent, double verticalPercent)
        {
            base.SetScrollPercent(horizontalPercent, verticalPercent);
        }

        /// <summary>
        /// Scrolls the content area of a container object in order to display the AutomationElement within the visible region (viewport) of the container.
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void ScrollIntoView()
        {
            base.ScrollIntoView();
        }

        /// <summary>
        /// Sets the scroll percentage to the top of the control.  
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void ScrollToTop()
        {
            base.ScrollToTop();
        }

        /// <summary>
        /// Deselects any selected items and then selects the current element.
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Select()
        {
            base.Select();
        }

        /// <summary>
        /// Adds the current element to the collection of selected items. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void AddToSelection()
        {
            base.AddToSelection();
        }

        /// <summary>
        /// Removes the current element to the collection of selected items. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void RemoveFromSelection()
        {
            base.RemoveFromSelection();
        }

        /// <summary>
        /// Gets a collection of automation elements that represents the current selection for an element.
        /// </summary>
        /// <returns>A collection of selected elements.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new AutomationElement[] GetSelection()
        {
            return base.GetSelection();
        }

        /// <summary>
        /// Gets the parent selection container of a control. 
        /// </summary>
        /// <returns>The <see cref="AutomationElement"/> of the parent control that implements the <see cref="SelectionPattern"/>.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement GetSelectionContainer()
        {
            return base.GetSelectionContainer(); 
        }

        /// <summary>
        /// Gets a collection of elements that represents all the column headers in a table.
        /// </summary>
        /// <returns>A collection of elements representing the column headers.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetColumnHeaders()
        {
            return base.GetColumnHeaders(); 
        }

        /// <summary>
        /// Gets a collection of elements that represents all the row headers in a table.
        /// </summary>
        /// <returns>A collection of elements representing the row headers.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetRowHeaders()
        {
            return base.GetRowHeaders(); 
        }

        /// <summary>
        /// Gets a collection of column headers associated with a table item or cell. 
        /// </summary>
        /// <returns>A collection of elements representing the column headers.</returns>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetColumnHeaderItems()
        {
            return base.GetColumnHeaderItems(); 
        }

        /// <summary>
        /// Gets a collection of row headers associated with a table item or cell. 
        /// </summary>
        /// <returns>A collection of elements representing the column headers.</returns>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement[] GetRowHeaderItems()
        {
            return base.GetRowHeaderItems(); 
        }

        /// <summary>
        /// Gets the container of a cell or item. 
        /// </summary>
        /// <returns>An <see cref="AutomationElement"/> that represents the container of a cell or item.</returns>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new AutomationElement GetContainingGrid()
        {
            return base.GetContainingGrid();
        }

        /// <summary>
        /// Retrieves a collection of text ranges that represents the currently selected text in a text-based control.
        /// </summary>
        /// <returns>A collection of disjoint text ranges.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new TextPatternRange[] GetTextSelection()
        {
            WaitForParentWindowToBeReady();
            return base.GetTextSelection();
        }

        /// <summary>
        /// Retrieves an array of disjoint text ranges from a text-based control where each text range represents a contiguous span of visible text.
        /// </summary>
        /// <returns>The collection of visible text ranges within the container or an empty array.</returns>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new TextPatternRange[] GetVisibleRanges()
        {
            return base.GetVisibleRanges();
        }

        /// <summary>
        /// Retrieves a text range enclosing a child element such as an image, hyperlink, Microsoft Excel spreadsheet, or other embedded object. 
        /// </summary>
        /// <returns>A range that spans the child element.</returns>
        /// <exception cref="ArgumentNullException">The child element is null.</exception>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new TextPatternRange RangeFromChild(AutomationElement childElement)
        {
            return base.RangeFromChild(childElement);
        }

        /// <summary>
        /// Returns the degenerate (empty) text range nearest to the specified screen coordinates. 
        /// </summary>
        /// <param name="screenLocation">The location in screen coordinates.</param>
        /// <returns>A degenerate range nearest the specified location. Null is never returned.</returns>
        /// <exception cref="ArgumentException">A given point is outside the <see cref="AutomationElement"/> associated with the text pattern.</exception>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new TextPatternRange RangeFromPoint(Point screenLocation)
        {
            return base.RangeFromPoint(screenLocation);
        }

        /// <summary>
        /// Toggles the current control. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        /// <remarks>A control will cycle through its ToggleState in this order: On, Off and, if supported, Indeterminate.</remarks>
        public new void Toggle()
        {
            base.Toggle();
        }

        /// <summary>
        /// Toggles on the current control. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void ToggleOn()
        {
            base.ToggleOn();
        }

        /// <summary>
        /// Toggles off the current control. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void ToggleOff()
        {
            base.ToggleOff();
        }

        /// <summary>
        /// Moves a control. 
        /// </summary>
        /// <param name="x">Absolute screen coordinates of the left side of the control.</param>
        /// <param name="y">Absolute screen coordinates of the top of the control.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Move(double x, double y)
        {
 
            base.Move(x, y);
        }

        /// <summary>
        /// Resizes a control. 
        /// </summary>
        /// <param name="width">The new width of the window, in pixels.</param>
        /// <param name="height">The new height of the window, in pixels.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Resize(double width, double height)
        {
            base.Resize(width, height);
        }

        /// <summary>
        /// Rotates a control. 
        /// </summary>
        /// <param name="degrees">The number of degrees to rotate the control. A positive number rotates clockwise; a negative number rotates counterclockwise.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Rotate(double degrees)
        {
            base.Rotate(degrees);
        }

        /// <summary>
        /// Inserts a string into a control that supports the value pattern. 
        /// </summary>
        /// <param name="value">The string to be inserted.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void SetValue(string value)
        {
            base.SetValue(value);
        }

        /// <summary>
        /// Sets the value for a range control.
        /// </summary>
        /// <param name="value">The value to set.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void SetRangeValue(double value)
        {
            base.SetRangeValue(value);
        }

        /// <summary>
        /// Closes a window type control. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element does is not available anymore.</exception>
        public new void Close()
        {
            base.Close();
        }

        /// <summary>
        /// Maximizes the specified window. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Maximize()
        {
            base.Maximize();
        }

        /// <summary>
        /// Minimizes the specified window. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Minimize()
        {
            base.Minimize();
        }

        /// <summary>
        /// Restores the specified window to its normal state. 
        /// </summary>
        /// <exception cref="InvalidOperationException">The pattern is not supported by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Restore()
        {
            base.Restore();
        }
    }
}
